<extend name="Public/base"/>

<block name="body">
    <style type="text/css">
    
    </style>
 

    <script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
    <div class="main-title">
        <h2>圈子管理 <button class="btn btn-default btn-return" onclick="javascript:history.back(-1);return false;"><i class="glyphicon glyphicon-share-alt"></i> 返 回</button></h2>
    </div>

     
    <div class="tab-content">
    <form action="" method="post" class="form">
            <div class="form-item form-group">
                <label class="item-label">名称<span class="check-tips"></span></label>
                <div class="controls">
                    <input type="text" class="form-control text input-large" name="name" value="{$name}" />
                </div>
            </div>
            <div class="form-item form-group">
                <label class="item-label">ICON<span class="check-tips">(*)</span></label>
                <div class="controls">
                    <input type="file" id="upload_picture_icon">
                    <input type="hidden" class="text input-large" name="icon" id="cover_id_icon" value="{$icon}" />
                    <div class="upload-img-box">
                    <notempty name="icon">
                        <div class="upload-pre-item"><img class="img-thumbnail" src="{:url_format($icon)}"/></div>
                    </notempty>
                    </div>
                </div>   
                <script type="text/javascript">
                //上传图片
                /* 初始化上传插件 */
                $("#upload_picture_icon").uploadify({
                    "height"          : 30,
                    "swf"             : "__STATIC__/uploadify/uploadify.swf",
                    "fileObjName"     : "download",
                    "buttonText"      : "上传图片",
                    "uploader"        : "{:U('File/uploadPicture',array('session_id'=>session_id()))}",
                    "width"           : 120,
                    'removeTimeout'   : 1,
                    'fileTypeExts'    : '*.jpeg; *.jpg; *.png; *.gif;',
                    "onUploadSuccess" : uploadpictureicon,
                    'onFallback' : function() {
                        alert('未检测到兼容版本的Flash.');
                    }
                });
                function uploadpictureicon(file, data){
                    var data = $.parseJSON(data);
                    var src = '';
                    if(data.status){
                        $("#cover_id_icon").val(data.path);
                        src = data.url || '__ROOT__' + data.path
                        $("#cover_id_icon").parent().find('.upload-img-box').html(
                            '<div class="upload-pre-item"><img src="' + src + '"/></div>'
                        );
                    } else {
                        updateAlert(data.info);
                        setTimeout(function(){
                            $('#top-alert').find('button').click();
                            $(that).removeClass('disabled').prop('disabled',false);
                        },1500);
                    }
                }
                </script>
            </div>

            <div class="form-item form-group">
                <label class="item-label">背景图<span class="check-tips">(*)</span></label>
                <div class="controls">
                    <input type="file" id="upload_picture_background">
                    <input type="hidden" class="text input-large" name="background" id="cover_id_background" value="{$background}" />
                    <div class="upload-img-box">
                    <notempty name="background">
                        <div class="upload-pre-item"><img class="img-thumbnail" src="{:url_format($background)}"/></div>
                    </notempty>
                    </div>
                </div>   
                <script type="text/javascript">
                //上传图片
                /* 初始化上传插件 */
                $("#upload_picture_background").uploadify({
                    "height"          : 30,
                    "swf"             : "__STATIC__/uploadify/uploadify.swf",
                    "fileObjName"     : "download",
                    "buttonText"      : "上传图片",
                    "uploader"        : "{:U('File/uploadPicture',array('session_id'=>session_id()))}",
                    "width"           : 120,
                    'removeTimeout'   : 1,
                    'fileTypeExts'    : '*.jpeg; *.jpg; *.png; *.gif;',
                    "onUploadSuccess" : uploadpicturebackground,
                    'onFallback' : function() {
                        alert('未检测到兼容版本的Flash.');
                    }
                });
                function uploadpicturebackground(file, data){
                    var data = $.parseJSON(data);
                    var src = '';
                    if(data.status){
                        $("#cover_id_background").val(data.path);
                        src = data.url || '__ROOT__' + data.path
                        $("#cover_id_background").parent().find('.upload-img-box').html(
                            '<div class="upload-pre-item"><img src="' + src + '"/></div>'
                        );
                    } else {
                        updateAlert(data.info);
                        setTimeout(function(){
                            $('#top-alert').find('button').click();
                            $(that).removeClass('disabled').prop('disabled',false);
                        },1500);
                    }
                }
                </script>
            </div>
          
            <div class="form-item form-group">
                <label class="item-label">描述<span class="check-tips"></span></label>
                <div class="controls">
                    <label class="input-large">
                         <input type="text" class="form-control text input-large" name="description" value="{$description}" />
                    </label>
                </div>
            </div>
            <div class="form-item form-group">
                <label class="item-label">公告<span class="check-tips"></span></label>
                <div class="controls">
                    <label class="input-large">
                         <textarea class="textarea form-control text input-large" name="notice">{$notice}</textarea>
                    </label>
                </div>
            </div>


            <div class="form-item form-group">
                <label class="item-label">状态<span class="check-tips"></span></label>
                <label class="radio-inline" >
                    <input type="radio" name="status" value="1"  /> 显示
                </label>
                <label class="radio-inline">
                    <input type="radio" name="status" value="0"  /> 不显示
                </label>
               
            </div>

        </div>

        <div class="form-item form-action">
            <input type="hidden" name="id" value="{$id}" />
            <button class="btn submit-btn ajax-post btn-success btn-block" id="submit" type="submit" target-form="form">确 定</button>
            <!-- <button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button> -->
        </div>
    </form>
    </div>
    <div id="video-pre">
        <video controls="controls" autoplay="autoplay"></video>
    </div>
</block>

<block name="script">
    <script src="__STATIC__/thinkbox/jquery.thinkbox.js"></script>
    <script type="text/javascript">
        //导航高亮
        highlight_subnav('{:U('Video/index')}');
        Think.setValue("status", '{$status|default=1}');
        
    </script>
</block>
